home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10459 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.2 KB  |  61 lines

  1. Path: news.xnet.com!news-admin
  2. From: kd9fb@xnet.com (Peter Mikalajunas)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Randomize
  5. Date: Fri, 08 Mar 1996 04:54:11 GMT
  6. Organization: XNet - A Full Service Internet Provider - (708) 983-6064
  7. Message-ID: <4hoe9f$r0n@flood.xnet.com>
  8. References: <313BD7D1.6143@IntNet.net>
  9. NNTP-Posting-Host: monsoon.xnet.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. Dave Cohoon <kahuna@IntNet.net> wrote:
  13.  
  14. >I have been learning C++ from books for the last 3 months, untill the next semester rolls around.
  15. >I've been working with "Teach Yourself C++ in 21 days" by Jesse Liberty.
  16.  
  17. >2 questions as follows:
  18.  
  19. >(1) I cannot find a way to create a randomized int, this is one of the simplest functions in
  20. >    basic, but in C++, I have no idea. Please Help.
  21.  
  22. #include <time.h>
  23. #define MAX 20
  24.  
  25. int irand()
  26. {
  27.     time_t t;
  28.     srand((unsigned) time(&t)+1);
  29.     return (int)(rand() % MAX);
  30. }
  31.  
  32.  
  33. >(2) As mentioned above, I have been studying c++, I have been able comprehend the commands and
  34. >    general jist, but even after spending copious amounts of time on a chapter,and writing sample
  35. >    code to help memorize it, I find that I am still having to turn back 200 pages or so to 
  36. >    refresh myself on something.  Is this "par for the course", or am I just not cracked up to
  37. >    learn this stuff???
  38.  
  39. It all depends.  If you constantly have to lookup cout, then things 
  40. are not going well.  On the other hand, if you are merely referencing
  41. library calls, or syntax, then this is common.
  42.  
  43. >    I was planning on taking a few coarses when school starts back up, in hope that one day I
  44. >    might actually program professionally, but it seems like I can never learn enough to complete
  45. >    the programs I'm working on.  Is there ever an end?
  46.  
  47. No, if you intend to program for a living, and continue to advance, 
  48. then continuing education in one form or another is part of the job.
  49.  
  50. >P.S.----recently heard a few rumors that JAVA will probably be the future standard for the 
  51. >windows environment, Does this seem to be a true prediction, and if so, How different is it from 
  52. >C++
  53.  
  54. Only in the dreams of certain engineers working at SUN.
  55. The tool sets available to programmers in windows will 
  56. never be limited to only one language.
  57.  
  58. kd9fb@xnet.com
  59. http://www.xnet.com/~kd9fb
  60.  
  61.